/*
 * @Descripttion: 
 * @Version: 
 * @Author: 王传宝
 * @Date: 2023-03-03 21:23:18
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-03-04 09:42:57
 */
import { configureStore } from '@reduxjs/toolkit'
import {combineReducers} from 'redux'
import { persistReducer,persistStore } from 'redux-persist'
import storage from 'redux-persist/lib/storage'
import thunk from 'redux-thunk'
import searchSlice from './slices/searchSlice'
import shoppingCar from './slices/shoppingCar'

const configStore = {
  key:'redux',
  storage,
  blackList:[]
}

const reducer = combineReducers({searchSlice,shoppingCar})

const persistedReducer = persistReducer(configStore,reducer)

const store = configureStore({
  reducer:persistedReducer,
  middleware:[thunk]
})

export default store
export const persist = persistStore(store)

